home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / include / arpa / tftp.h < prev   
Encoding:
C/C++ Source or Header  |  1994-08-11  |  2.2 KB  |  68 lines

  1. /*
  2.  * Copyright (c) 1983 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that: (1) source distributions retain this entire copyright
  7.  * notice and comment, and (2) distributions including binaries display
  8.  * the following acknowledgement:  ``This product includes software
  9.  * developed by the University of California, Berkeley and its contributors''
  10.  * in the documentation or other materials provided with the distribution
  11.  * and in all advertising materials mentioning features or use of this
  12.  * software. Neither the name of the University nor the names of its
  13.  * contributors may be used to endorse or promote products derived
  14.  * from this software without specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  *
  19.  *    @(#)tftp.h    5.3 (Berkeley) 6/1/90
  20.  */
  21.  
  22. #ifndef _ARPA_TFTP_H_
  23. #define _ARPA_TFTP_H_
  24.  
  25. /*
  26.  * Trivial File Transfer Protocol (IEN-133)
  27.  */
  28. #define    SEGSIZE        512        /* data segment size */
  29.  
  30. /*
  31.  * Packet types.
  32.  */
  33. #define    RRQ    01            /* read request */
  34. #define    WRQ    02            /* write request */
  35. #define    DATA    03            /* data packet */
  36. #define    ACK    04            /* acknowledgement */
  37. #define    ERROR    05            /* error code */
  38.  
  39. struct    tftphdr {
  40.     short    th_opcode;        /* packet type */
  41.     union {
  42.         short    tu_block;    /* block # */
  43.         short    tu_code;    /* error code */
  44.         char    tu_stuff[1];    /* request packet stuff */
  45.     } th_u;
  46.     char    th_data[1];        /* data or error string */
  47. };
  48.  
  49. #define    th_block    th_u.tu_block
  50. #define    th_code        th_u.tu_code
  51. #define    th_stuff    th_u.tu_stuff
  52. #define    th_msg        th_data
  53.  
  54. /*
  55.  * Error codes.
  56.  */
  57. #define    EUNDEF        0        /* not defined */
  58. #define    ENOTFOUND    1        /* file not found */
  59. #define    EACCESS        2        /* access violation */
  60. #define    ENOSPACE    3        /* disk full or allocation exceeded */
  61. #define    EBADOP        4        /* illegal TFTP operation */
  62. #define    EBADID        5        /* unknown transfer ID */
  63. #define    EEXISTS        6        /* file already exists */
  64. #define    ENOUSER        7        /* no such user */
  65.  
  66. #endif /* _ARPA_TFTP_H_ */
  67.  
  68.